package utils

import (
	"time"

	"github.com/google/uuid"
)

func TemplateTracks() map[string]interface{} {
	return map[string]interface{}{
		"attribute": 0,
		"flag":      0,
		"id":        uuid.New().String(),
		"segments":  []interface{}{},
		"type":      "",
	}
}

func TemplateMaterials() map[string]interface{} {
	return map[string]interface{}{
		"create_time":    time.Now().Unix(),
		"duration":       5000000,
		"extra_info":     "",
		"file_Path":      "",
		"width":          800,
		"height":         450,
		"id":             uuid.New().String(),
		"import_time":    time.Now().Unix(),
		"import_time_ms": time.Now().UnixNano() / int64(time.Millisecond),
		"item_source":    1,
		"md5":            "",
		"metetype":       "",
		"roughcut_time_range": map[string]int{
			"duration": 0,
			"start":    -1,
		},
		"sub_time_range": map[string]int{
			"duration": 0,
			"start":    -1,
		},
		"type": 0,
	}
}

func TemplateAudios() map[string]interface{} {
	return map[string]interface{}{
		"app_id":             0,
		"category_id":        "",
		"category_name":      "local",
		"check_flag":         1,
		"duration":           3000000,
		"effect_id":          "",
		"formula_id":         "",
		"id":                 uuid.New().String(),
		"intensifies_path":   "",
		"local_material_id":  "d53d0281-04d0-4af3-a165-f5e0025ba2a2",
		"music_id":           uuid.New().String(),
		"name":               "",
		"path":               "",
		"request_id":         "",
		"resource_id":        "",
		"source_platform":    0,
		"team_id":            "",
		"text_id":            "",
		"tone_category_id":   "",
		"tone_category_name": "",
		"tone_effect_id":     "",
		"tone_effect_name":   "",
		"tone_speaker":       "",
		"tone_type":          "",
		"type":               "extract_music",
		"video_id":           "",
		"wave_points":        []interface{}{},
	}
}

func TemplateBeats() map[string]interface{} {
	return map[string]interface{}{
		"ai_beats": map[string]interface{}{
			"beats_path":      "",
			"beats_url":       "",
			"melody_path":     "",
			"melody_percents": []float64{0.0},
			"melody_url":      "",
		},
		"enable_ai_beats":      false,
		"gear":                 404,
		"id":                   uuid.New().String(),
		"mode":                 404,
		"type":                 "beats",
		"user_beats":           []interface{}{},
		"user_delete_ai_beats": nil,
	}
}

func TemplateCanvases() map[string]interface{} {
	return map[string]interface{}{
		"album_image":     "",
		"blur":            0.0,
		"color":           "",
		"id":              uuid.New().String(),
		"image":           "",
		"image_id":        "",
		"image_name":      "",
		"source_platform": 0,
		"team_id":         "",
		"type":            "canvas_color",
	}
}

func TemplateSoundChannelMappings() map[string]interface{} {
	return map[string]interface{}{
		"audio_channel_mapping": 0,
		"id":                    uuid.New().String(),
		"is_config_open":        false,
		"type":                  "none",
	}
}

func TemplateSpeeds() map[string]interface{} {
	return map[string]interface{}{
		"curve_speed": nil,
		"id":          uuid.New().String(),
		"mode":        0,
		"speed":       1.0,
		"type":        "speed",
	}
}

func TemplateVideos() map[string]interface{} {
	return map[string]interface{}{
		"audio_fade":    nil,
		"cartoon_path":  "",
		"category_id":   "",
		"category_name": "local",
		"check_flag":    63487,
		"crop": map[string]float64{
			"lower_left_x":  0.0,
			"lower_left_y":  1.0,
			"lower_right_x": 1.0,
			"lower_right_y": 1.0,
			"upper_left_x":  0.0,
			"upper_left_y":  0.0,
			"upper_right_x": 1.0,
			"upper_right_y": 0.0,
		},
		"crop_ratio":             "free",
		"crop_scale":             1.0,
		"duration":               10800000000,
		"extra_type_option":      0,
		"formula_id":             "",
		"freeze":                 nil,
		"gameplay":               nil,
		"has_audio":              true,
		"height":                 450,
		"id":                     uuid.New().String(),
		"intensifies_audio_path": "",
		"intensifies_path":       "",
		"is_unified_beauty_mode": false,
		"local_id":               "",
		"local_material_id":      "",
		"material_id":            "",
		"material_name":          "",
		"material_url":           "",
		"matting": map[string]interface{}{
			"flag":                 0,
			"has_use_quick_brush":  false,
			"has_use_quick_eraser": false,
			"interactiveTime":      []interface{}{},
			"path":                 "",
			"strokes":              []interface{}{},
		},
		"media_path":                "",
		"object_locked":             nil,
		"path":                      "",
		"picture_from":              "none",
		"picture_set_category_id":   "",
		"picture_set_category_name": "",
		"request_id":                "",
		"reverse_intensifies_path":  "",
		"reverse_path":              "",
		"source_platform":           0,
		"stable":                    nil,
		"team_id":                   "",
		"type":                      "photo",
		"video_algorithm": map[string]interface{}{
			"algorithms":         []interface{}{},
			"deflicker":          nil,
			"motion_blur_config": nil,
			"noise_reduction":    nil,
			"path":               "",
			"time_range":         nil,
		},
		"width": 800,
	}
}

func TemplateSegments() map[string]interface{} {
	return map[string]interface{}{
		"cartoon": false,
		"clip": map[string]interface{}{
			"alpha": 1.0,
			"flip": map[string]bool{"horizontal": false, "vertical": false},
			"rotation": 0.0,
			"scale": map[string]float64{"x": 1.0, "y": 1.0},
			"transform": map[string]float64{"x": 0.0, "y": 0.0},
		},
		"common_keyframes": []interface{}{},
		"enable_adjust": true,
		"enable_color_curves": true,
		"enable_color_wheels": true,
		"enable_lut": true,
		"enable_smart_color_adjust": false,
		"extra_material_refs": []interface{}{},
		"group_id": "",
		"hdr_settings": map[string]interface{}{"intensity": 1.0, "mode": 1, "nits": 1000},
		"id": uuid.New().String(),
		"intensifies_audio": false,
		"is_placeholder": false,
		"is_tone_modify": false,
		"keyframe_refs": []interface{}{},
		"last_nonzero_volume": 1.0,
		"material_id": "",
		"render_index": 0,
		"reverse": false,
		"source_timerange": map[string]int{"duration": 3766667, "start": 0},
		"speed": 1.0,
		"target_timerange": map[string]int{"duration": 3766667, "start": 7466666},
		"template_id": "",
		"template_scene": "default",
		"track_attribute": 0,
		"track_render_index": 0,
		"uniform_scale": nil,
		"visible": true,
		"volume": 1.0,
	}
}
